<!--  -->
<template>
  <div class='outsideBox'>
    <div class="innerMessage">
      <div class="topBoxSteps">
        <el-steps :active="active" finish-status="success">
          <el-step title="基本信息"></el-step>
          <el-step title="补充信息"></el-step>
          <el-step title="完成"></el-step>
        </el-steps>
      </div>
      <div class="basicUser" v-show="active === 0">
        <el-form ref="companyForm" size="small" :model="basicFrom" :rules="addbasicRule" label-width="80px">
          <el-form-item label="姓名" prop="username">
            <el-input v-model="basicFrom.username"></el-input>
          </el-form-item>
          <el-form-item label="性别" prop="gender">
            <el-select v-model="basicFrom.gender" placeholder="请选择">
              <el-option
              v-for="(item,index) in genderArr"
              :key="index"
              :label="item.name"
              :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="手机号" prop="phone">
            <el-input v-model="basicFrom.phone"></el-input>
          </el-form-item>
          <el-form-item label="身份证号" prop="idnum">
            <el-input v-model="basicFrom.idnum"></el-input>
          </el-form-item>
          <el-form-item label="所在城市" prop="city">
            <el-cascader
              class="widthSmall"
              size="large"
              :options="options"
              v-model="basicFrom.city"
              @change="baseaddressChange">
            </el-cascader>
          </el-form-item>
          <el-form-item label="出生日期" prop="birthday">
            <el-date-picker
              type="date"
              placeholder="选择出生日期"
              v-model="basicFrom.birthday"
              @change="chooseBirthday"
              style="width: 100%;"></el-date-picker>
          </el-form-item>
          <el-form-item label="家庭住址" prop="homeaddress">
            <el-input v-model="basicFrom.homeaddress" type="textarea" placeholder="请输入家庭住址"></el-input>
          </el-form-item>
          <el-form-item label="现居住地址" prop="nowaddress">
            <el-input v-model="basicFrom.nowaddress" type="textarea" placeholder="请输入现居住地址"></el-input>
          </el-form-item>
          <el-form-item label="婚姻状况" prop="maritalstatus">
            <el-select v-model="basicFrom.maritalstatus" placeholder="请选择">
              <el-option
                v-for="(item,index) in maritalstatusArr"
                :key="index"
                :label="item.name"
                :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <div class="detailMsg" v-show="active === 1">
        <el-collapse accordion>
          <el-collapse-item>
            <template slot="title">
              车辆信息
            </template>
            <el-form ref="carFrom" size="small" :model="carFrom" label-width="100px">
              <el-form-item label="是否有车">
                <el-radio-group v-model="carFrom.ishavecar">
                  <el-radio label="是"></el-radio>
                  <el-radio label="否"></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>
            <el-form ref="carFrom" size="small" :model="carFrom" label-width="100px" v-show="carFrom.ishavecar == '是'">
              <el-form-item label="绿本照片">
                <local-updateone-image v-model="carFrom.greenImg" @change="changeGreenImg"/>
              </el-form-item>
              <el-form-item label="行驶证照片">
                <local-updateone-image v-model="carFrom.drivProofImg" @change="changedriveImg"/>
              </el-form-item>
              <el-form-item label="车辆品牌">
                <el-input v-model="carFrom.carBrand" placeholder="请输入车辆品牌"></el-input>
              </el-form-item>
              <el-form-item label="车辆类型">
                <el-select v-model="carFrom.carType" placeholder="请选择">
                  <el-option
                    v-for="(item,index) in carTypeArr"
                    :key="index"
                    :label="item.name"
                    :value="item.id"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="车辆所属城市">
                <el-cascader
                  class="widthSmall"
                  size="large"
                  :options="optionsForCar"
                  v-model="carFrom.carCity"
                  @change="caraddressChange">
                </el-cascader>
              </el-form-item>
              <el-form-item label="车辆识别代号">
                <el-input v-model="carFrom.carSeeNum" placeholder="请输入车辆识别代号"></el-input>
              </el-form-item>
              <el-form-item label="发动机号">
                <el-input v-model="carFrom.engineNum" placeholder="请输入发动机号"></el-input>
              </el-form-item>
              <el-form-item label="是否按揭">
                <el-radio-group v-model="carFrom.isInstall">
                  <el-radio label="是" name="是"></el-radio>
                  <el-radio label="否" name="否"></el-radio>
                </el-radio-group>
              </el-form-item>
              
            </el-form>
          </el-collapse-item>
          <el-collapse-item>
            <template slot="title">
              房屋信息
            </template>
            <el-form ref="houseFrom" size="small" :model="houseFrom" label-width="100px">
              <el-form-item label="是否有房">
                <el-radio-group v-model="houseFrom.ishaveHouse" @input="changeHaveCar">
                  <el-radio label="是"></el-radio>
                  <el-radio label="否"></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>
            <el-form ref="houseFrom" size="small" :model="houseFrom" label-width="100px" v-show="houseFrom.ishaveHouse == '是'">
              <el-form-item label="是否按揭">
                <el-radio-group v-model="houseFrom.isInstallHou" @input="changeHaveCar">
                  <el-radio label="是"></el-radio>
                  <el-radio label="否"></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>
            <el-form ref="houseFrom" size="small" :model="houseFrom" label-width="100px" v-show="houseFrom.ishaveHouse == '是'">
              <el-form-item label="房屋合同照片" v-show="houseFrom.isInstallHou == '是'">
                <local-updateone-image v-model="houseFrom.houseContractImg" @change="changehouseImg"/>
              </el-form-item>
              <el-form-item label="合同人姓名" v-show="houseFrom.isInstallHou == '是'">
                <el-input v-model="houseFrom.contractName" placeholder="请输入合同人姓名"></el-input>
              </el-form-item>
              <!-- <el-form-item label="不动产照片">
                <local-updateone-image v-model="houseFrom.houseImg"/>
              </el-form-item> -->
              <el-form-item label="房本姓名">
                <el-input v-model="houseFrom.houseName" placeholder="请输入房本姓名"></el-input>
              </el-form-item>
              <el-form-item label="房屋性质">
                <el-select v-model="houseFrom.houseNature" placeholder="请选择">
                  <el-option
                    v-for="(item,index) in houseNatureArr"
                    :key="index"
                    :label="item.name"
                    :value="item.id"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="所在城市">
                <el-cascader
                  class="widthSmall"
                  size="large"
                  :options="optionsForHouse"
                  v-model="houseFrom.houseCity"
                  @change="houseaddressChange">
                </el-cascader>
              </el-form-item>
              <el-form-item label="房屋地址">
                <el-input v-model="houseFrom.houseAddress" placeholder="请输入房屋地址"></el-input>
              </el-form-item>
              <el-form-item label="不动产单元号">
                <el-input v-model="houseFrom.houseDong" placeholder="请输入不动产单元号"></el-input>
              </el-form-item>
              <el-form-item label="房屋类型">
                <el-input v-model="houseFrom.houseType" placeholder="请输入房屋类型"></el-input>
              </el-form-item>
              <el-form-item label="用途">
                <el-input v-model="houseFrom.houseFun" placeholder="请输入用途"></el-input>
              </el-form-item>
              <el-form-item label="面积">
                <el-input v-model="houseFrom.houseSize" placeholder="请输入面积"></el-input>
              </el-form-item>
              <el-form-item label="房龄">
                <el-input v-model="houseFrom.houseAge" placeholder="请输入房龄"></el-input>
              </el-form-item>
              <el-form-item label="权利其他情况">
                <el-input v-model="houseFrom.houseOthers" placeholder="权利其他情况"></el-input>
              </el-form-item>
              
            </el-form>
          </el-collapse-item>
          <el-collapse-item>
            <template slot="title">
              企业融资信息
            </template>
            <el-form ref="enterpriseFrom" size="small" :model="enterpriseFrom" label-width="100px">
              <el-form-item label="是否企业融资">
                <el-radio-group v-model="enterpriseFrom.ishaveEnter" @input="changeHaveCar">
                  <el-radio label="是"></el-radio>
                  <el-radio label="否"></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>
            <el-form ref="enterpriseFrom" size="small" :model="enterpriseFrom" label-width="100px" v-show="enterpriseFrom.ishaveEnter == '是'">
              <el-form-item label="营业执照照片">
                <local-updateone-image v-model="enterpriseFrom.enterImg" @change="changeenterImg" />
              </el-form-item>
              <el-form-item label="公司名称">
                <el-input v-model="enterpriseFrom.enterName" placeholder="请输入公司名称"></el-input>
              </el-form-item>
              <el-form-item label="公司地址">
                <el-input v-model="enterpriseFrom.enterAddress" placeholder="请输入公司地址"></el-input>
              </el-form-item>
              <el-form-item label="公司电话">
                <el-input v-model="enterpriseFrom.enterPhone" placeholder="请输入公司电话"></el-input>
              </el-form-item>
              <el-form-item label="企业身份">
                <el-select v-model="enterpriseFrom.enterRole" placeholder="请选择">
                  <el-option
                    v-for="(item,index) in enterRoleArr"
                    :key="index"
                    :label="item.name"
                    :value="item.id"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="持股百分比">
                <el-input v-model="enterpriseFrom.proPortion" placeholder="请输入持股百分比"></el-input>
              </el-form-item>
            </el-form>
          </el-collapse-item>
          <el-collapse-item>
            <template slot="title">
              税贷信息
            </template>
            <el-form ref="taxFrom" size="small" :model="taxFrom" label-width="100px">
              <el-form-item label="是否税贷">
                <el-radio-group v-model="taxFrom.ishaveTax" @input="changeHaveCar">
                  <el-radio label="是" name="是"></el-radio>
                  <el-radio label="否" name="否"></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>
            <el-form ref="taxFrom" size="small" :model="taxFrom" label-width="100px" v-show="taxFrom.ishaveTax == '是'">
              <el-form-item label="年度缴税额">
                <el-input v-model="taxFrom.taxAuota" placeholder="请输入年度缴税额"></el-input>
              </el-form-item>
              <el-form-item label="纳税等级">
                <el-select v-model="taxFrom.TaxLevel" placeholder="请选择">
                  <el-option
                    v-for="(item,index) in TaxLevelArr"
                    :key="index"
                    :label="item.name"
                    :value="item.id"></el-option>
                </el-select>
              </el-form-item>
            </el-form>
          </el-collapse-item>
          <el-collapse-item>
            <template slot="title">
              其他信息
            </template>
            <div class="workMsg">
              工作信息
            </div>
            <el-form ref="workFrom" size="small" :model="workFrom" label-width="100px">
              <el-form-item label="打卡工资金额">
                <el-input v-model="workFrom.paynum" placeholder="请输入打卡工资金额"></el-input>
              </el-form-item>
              <el-form-item label="工资发放形式">
                <el-select v-model="workFrom.payment" placeholder="请选择">
                  <el-option
                    v-for="(item,index) in paymentArr"
                    :key="index"
                    :label="item.name"
                    :value="item.id"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="企业性质">
                <el-select v-model="workFrom.worktype" placeholder="请选择">
                  <el-option
                    v-for="(item,index) in worktypeArr"
                    :key="index"
                    :label="item.name"
                    :value="item.id"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="单位电话">
                <el-input v-model="workFrom.workphone" placeholder="请输入单位电话"></el-input>
              </el-form-item>
            </el-form>

            <div class="workMsg">
              社保公积金
            </div>
            <el-form ref="shebaoGjj" size="small" :model="shebaoGjj" label-width="100px">
              <el-form-item label="公积金个缴">
                <el-input v-model="shebaoGjj.gjjAmount" placeholder="请输入公积金个缴"></el-input>
              </el-form-item>
              <el-form-item label="公积金基数">
                <el-input v-model="shebaoGjj.gjjNum" placeholder="请输入公积金基数"></el-input>
              </el-form-item>
              <el-form-item label="缴纳时长">
                <el-input v-model="shebaoGjj.gjjTime" placeholder="请输入缴纳时长"></el-input>
              </el-form-item>
              <el-form-item label="社保基数">
                <el-input v-model="shebaoGjj.bdAmount" placeholder="请输入缴纳时长"></el-input>
              </el-form-item>
              <el-form-item label="缴纳时长">
                <el-input v-model="shebaoGjj.bdTime" placeholder="请输入缴纳时长"></el-input>
              </el-form-item>
            </el-form>

            <div class="workMsg">
              其他信息
            </div>
            <el-form ref="othermsg" size="small" :model="othermsg" label-width="100px">
              <el-form-item label="支付宝芝麻分">
                <el-input v-model="othermsg.aliNum" placeholder="请输入支付宝芝麻分"></el-input>
              </el-form-item>
              <el-form-item label="微粒贷额度">
                <el-input v-model="othermsg.wechatNum" placeholder="请输入微粒贷额度"></el-input>
              </el-form-item>
            </el-form>

            <div class="workMsg">
              保单
            </div>
            <el-form ref="baodan" size="small" :model="baodan" label-width="100px">
              <el-form-item label="一年以上的保单">
                <local-updateone-image v-model="baodan.baodanImg" @change="changebaodanimg"/>
              </el-form-item>
              <!-- <el-form-item label="单份最高金额">
                <el-input v-model="baodan.baodanBigmon" placeholder="请输入单份最高金额"></el-input>
              </el-form-item>
              <el-form-item label="保单缴费时长">
                <el-input v-model="baodan.baodanhowtime" placeholder="请输入保单缴费时长"></el-input>
              </el-form-item> -->
            </el-form>
          </el-collapse-item>
          <el-collapse-item>
            <template slot="title">
              联系人信息
            </template>
            <el-form ref="friendFrom" size="small" :model="friendFrom" label-width="100px">
              <el-form-item label="联系人姓名">
                <el-input v-model="friendFrom.name" placeholder="请输入联系人姓名"></el-input>
              </el-form-item>
              <el-form-item label="关系">
                <el-select v-model="friendFrom.relation" placeholder="请选择">
                  <el-option
                    v-for="(item,index) in relationArr"
                    :key="index"
                    :label="item.name"
                    :value="item.id"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="联系人电话">
                <el-input v-model="friendFrom.phone" placeholder="请输入联系人电话"></el-input>
              </el-form-item>
              <el-form-item label="联系人单位">
                <el-input v-model="friendFrom.comName" placeholder="请输入联系人单位"></el-input>
              </el-form-item>
            </el-form>
          </el-collapse-item>
        </el-collapse>
      </div>
      <div class="lastPage" v-show="active === 2">
        <div class="okBox">
          <img src="./../../img/itisok.png" alt="">
        </div>
        <div class="okMsg">
          预计10分钟完成审核，审核通过后业务经理将和您联系，请注意查看！
        </div>
      </div>
      <div :class="(active === 0 || active === 1) ? 'bottomBtn' : 'lastBtn'" @click="next">
        {{ innerBtnWords }}
      </div>
    </div>
  </div>
</template>

<script>
import { provinceAndCityData, CodeToText } from 'element-china-area-data'
import localUpdateoneImage from "@/components/localUpdateoneImage";
import { qrQuotaSubmit, fileUploadFile } from '@/request/landingpage';
import { formatChineseDate } from '@/until/paramRou';
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {
    localUpdateoneImage
  },
  data() {
  //这里存放数据
    return {
      // 保单
      baodan: {
        baodanImg: ''
      },
      // 其他信息
      othermsg: {
        aliNum: '',
        wechatNum: ''
      },
      // 公积金社保
      shebaoGjj: {
        gjjAmount: '',
        gjjNum: '',
        gjjTime: '',
        bdAmount: '',
        bdTime: '',
      },
      // 工作信息
      workFrom: {
        paynum: '',
        payment: '',
        worktype: '',
        workphone: ''
      },
      paymentArr: [
        {
          name: '打卡',
          id: 1
        },
        {
          name: '转账',
          id: 2
        },
        {
          name: '现金',
          id: 3
        },
        {
          name: '打卡加现金',
          id: 4
        },
        {
          name: '转账加现金',
          id: 5
        },
      ],
      worktypeArr: [
        {
          name: '国有企业',
          id: '1'
        },
        {
          name: '集体所有制企业',
          id: '2'
        },
        {
          name: '联营企业',
          id: '3'
        },
        {
          name: '三资企业',
          id: '4'
        },
        {
          name: '私营企业',
          id: '5'
        },
      ],
      relationArr: [
        {
          name: '父亲',
          id: 1
        },
        {
          name: '母亲',
          id: 2
        },
        {
          name: '姐妹',
          id: 3
        },
        {
          name: '兄弟',
          id: 4
        },
        {
          name: '朋友',
          id: 5
        },
        {
          name: '同事',
          id: 6
        },
        {
          name: '夫妻',
          id: 7
        },
        {
          name: '子女',
          id: 8
        },
        {
          name: '其他',
          id: 9
        }
      ],
      friendFrom: {
        name: '',
        relation: '',
        phone: '',
        comName: '',
      },
      taxFrom: {
        ishaveTax: '',
        taxAuota: '',
        TaxLevel: ''
      },
      TaxLevelArr: [
        {
          name: 'A',
          id: 'A'
        },
        {
          name: 'B',
          id: 'B'
        },
        {
          name: 'M',
          id: 'M'
        },
        {
          name: 'C',
          id: 'C'
        },
        {
          name: 'D',
          id: 'D'
        }
      ],
      enterpriseFrom: {
        ishaveEnter:'',
        enterImg:'',
        enterName:'',
        enterAddress:'',
        enterPhone:'',
        enterRole:'',
        proPortion:''
      },
      enterRoleArr: [
        {
          name: '法人',
          id: 1
        },
        {
          name: '股东',
          id: 2
        }
      ],
      houseFrom: {
        ishaveHouse: '',
        isInstallHou: '',
        houseContractImg: '',
        contractName: '',
        houseImg: '',
        houseName: '',
        houseStatus: '',
        houseCity: '',
        houseCityword: '',
        houseAddress: '',
        houseDong: '',
        houseNature: '',
        houseFun: '',
        houseSize: '',
        houseAge: '',
        houseOthers: ''
      },
      houseNatureArr: [
        {
          name: '全款房',
          id: 1
        },
        {
          name: '商业按揭房',
          id: 2
        },
        {
          name: '公积金按揭房',
          id: 3
        },
        {
          name: '租房',
          id: 4
        }
      ],
      optionsForCar: provinceAndCityData,
      optionsForHouse: provinceAndCityData,
      carFrom: {
        ishavecar: '',
        greenImg: '',
        drivProofImg: '',
        carBrand: '',
        carType: '', 
        carCity: '',
        carCityword: '',
        carSeeNum: '',
        engineNum: '',
        isInstall: ''
      },
      carTypeArr: [
        {
          name: '轿车',
          id: 1
        },
        {
          name: '货车',
          id: 2
        }
      ],
      innerBtnWords: '下一步',
      active: 0,
      options: provinceAndCityData, // 省市区数据
      genderArr: [
        {
          name: '男',
          id: 1
        },
        {
          name: '女',
          id: 2
        }
      ],
      maritalstatusArr: [
        {
          name: '未婚',
          id: 0
        },
        {
          name: '已婚',
          id: 1
        },
        {
          name: '离异',
          id: 2
        },
        {
          name: '丧偶',
          id: 3
        }
      ],
      basicFrom: {
        username: '',
        gender: '',
        phone: '',
        idnum: '',
        city: null,
        cityword: '',
        birthday: '',
        homeaddress: '',
        nowaddress: '',
        maritalstatus: '',
      },
      addbasicRule: {
        username: [
          { required: true, trigger: 'blur', message: '请输入您的详细地址' }
        ],
        gender: [
          { required: true, trigger: 'change', message: '请选择性别' }
        ],
        phone: [
          { required: true, trigger: 'blur', message: '请输入您的手机号' },
          {
            validator (_, value, callback) {
              const regTel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
              if (!regTel.test(value)) {
                callback(new Error('手机号不符合规则'))
              } else {
                callback()
              }
            },
            trigger: 'blur'
          }
        ],
        idnum: [
          { required: true, trigger: 'blur', message: '请输入身份证号码' }
        ],
        city: [
          { required: true, trigger: 'change', message: '请选择您的城市' }
        ],
        birthday: [
          { required: true, trigger: 'change', message: '请选择出生日期' }
        ],
        homeaddress: [
          { required: true, trigger: 'blur', message: '请输入家庭住址' }
        ],
        nowaddress: [
          { required: true, trigger: 'blur', message: '请输入现居住地址' }
        ],
        maritalstatus: [
          { required: true, trigger: 'change', message: '请选择婚姻状况' }
        ]
      },
      globalNum: 0
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //方法集合
  methods: {
    // 个人信息 - 确定生日
    chooseBirthday(){
      this.basicFrom.birthday = formatChineseDate(this.basicFrom.birthday)
    },
    // 个人信息 - 确定用户所在城市
    baseaddressChange(arr){
      this.basicFrom.cityword = CodeToText[arr[0]] + CodeToText[arr[1]]
    },
    // 房屋信息 - 确定房屋所在城市
    houseaddressChange(arr){
      this.houseFrom.houseCityword = CodeToText[arr[0]] + CodeToText[arr[1]]
    },
    // 车辆信息 - 确定车辆所在城市
    caraddressChange(arr){
      this.carFrom.carCityword = CodeToText[arr[0]] + CodeToText[arr[1]]
    },
    // 车辆信息 - 确定绿本照片
    changeGreenImg(val){
      const formData = new FormData();
      formData.append("file", val);
      fileUploadFile(formData).then(res => {
        if (res.code === '200') {
          this.carFrom.greenImg = res.data
        }
      })
    },
    // 车辆信息 - 确定行驶证照片
    changedriveImg(val){
      const formData = new FormData();
      formData.append("file", val);
      fileUploadFile(formData).then(res => {
        if (res.code === '200') {
          this.carFrom.drivProofImg = res.data
        }
      })
    },
    // 房屋信息 - 确定房本照片
    changehouseImg(val){
      const formData = new FormData();
      formData.append("file", val);
      fileUploadFile(formData).then(res => {
        if (res.code === '200') {
          this.houseFrom.houseContractImg = res.data
        }
      })
    },
    // 企业融资信息 - 确定企业信息照片
    changeenterImg(val){
      const formData = new FormData();
      formData.append("file", val);
      fileUploadFile(formData).then(res => {
        if (res.code === '200') {
          this.enterpriseFrom.enterImg = res.data
        }
      })
    },
    // 保单信息 - 确定保单照片
    changebaodanimg(val){
      const formData = new FormData();
      formData.append("file", val);
      fileUploadFile(formData).then(res => {
        if (res.code === '200') {
          this.baodan.baodanImg = res.data
        }
      })
    },
    // 切换是否有车
    changeHaveCar(){
      if (this.carFrom.ishavecar == '是') {
        
      } else {

      }
      
    },
    addressChange(){},
    next(){
      
      this.$refs.companyForm.validate((valid) => {
        if (valid) {
          if (this.active++ > 2) {
            this.active = 0;
          }
          if (this.active === 1) {
            localStorage.setItem('basicFrom',JSON.stringify(this.basicFrom))
            this.innerBtnWords = '提交'
          } else if (this.active === 2) {
            this.innerBtnWords = '完成'
            let obj = {
              key: sessionStorage.getItem('configkey'),
              base: { // 原始信息
                birthday: this.basicFrom.birthday,
                city: this.basicFrom.cityword,
                houseAddress: this.basicFrom.homeaddress,
                idCard: this.basicFrom.idnum,
                marriageStatus:this.basicFrom.maritalstatus,
                name: this.basicFrom.username,
                nowAddress: this.basicFrom.nowaddress,
                phone: this.basicFrom.phone,
                sex: this.basicFrom.gender
              },
              car: { // 车辆
                brand: this.carFrom.carBrand,// 品牌
                carPic: this.carFrom.greenImg,
                city: this.carFrom.carCityword,
                code: this.carFrom.carSeeNum,
                drivePic: this.carFrom.drivProofImg,
                engineNum: this.carFrom.engineNum,
                isCar: this.carFrom.ishavecar = this.carFrom.ishavecar == '是' ? 1 : this.carFrom.ishavecar == '否' ? 0 : '',
                isStages: this.carFrom.isInstall = this.carFrom.isInstall == '是' ? 1 : this.carFrom.isInstall == '否' ? 0 : '',
                type: this.carFrom.carType
              },
              com: { // 企业融资
                address: this.enterpriseFrom.enterAddress,
                comName: this.enterpriseFrom.enterName,
                comPhone: this.enterpriseFrom.enterPhone,
                isCom: this.enterpriseFrom.ishaveEnter = this.enterpriseFrom.ishaveEnter == '是' ? 1 : this.enterpriseFrom.ishaveEnter == '否' ? 0 : '',
                owenShip: this.enterpriseFrom.proPortion,
                pic: this.enterpriseFrom.enterImg,
                userRole: this.enterpriseFrom.enterRole,
              },
              house: { // 房屋信息
                age: this.houseFrom.houseAge,
                area: this.houseFrom.houseSize,
                city: this.houseFrom.houseCityword,
                houseName: this.houseFrom.houseName,
                houseNature: this.houseFrom.houseNature,
                houseUse: this.houseFrom.houseFun,
                isHouse: this.houseFrom.ishaveHouse = this.houseFrom.ishaveHouse == '是' ? 1 : this.houseFrom.ishaveHouse == '否' ? 0 : '',
                isStages: this.houseFrom.isInstallHou = this.houseFrom.isInstallHou == '是' ? 1 : this.houseFrom.isInstallHou == '否' ? 0 : '',
                pic: this.houseFrom.houseContractImg,
                remark: this.houseFrom.houseOthers,
                type: this.houseFrom.houseType,
                unitNum: this.houseFrom.houseDong
              },
              liaise: { // 联系人
                comName: this.friendFrom.comName,
                name: this.friendFrom.name,
                phone: this.friendFrom.phone,
                relation: this.friendFrom.relation
              },
              other: { // 其他信息
                aliNum: this.othermsg.aliNum,
                bdAmount: this.shebaoGjj.bdAmount,
                bdTime: this.shebaoGjj.bdTime,
                comPhone: this.workFrom.workphone,
                gjjAmount: this.shebaoGjj.gjjAmount,
                gjjNum: this.shebaoGjj.gjjNum,
                gjjTime: this.shebaoGjj.gjjTime,
                pic: this.baodan.baodanImg,
                wages: this.workFrom.paynum,
                wagesType: this.workFrom.payment,
                wechatNum: this.othermsg.wechatNum,
                workType: this.workFrom.worktype,
              },
              tax: { // 税贷
                isTax: this.taxFrom.ishaveTax = this.taxFrom.ishaveTax == '是' ? 1 : this.taxFrom.ishaveTax == '否' ? 0 : '',
                taxGrade: this.taxFrom.taxGrade,
                taxNum: this.taxFrom.taxAuota
              }
            }
            
            qrQuotaSubmit(obj).then(res => {
              if (res.code === '200') {
                this.$message({
                  type: 'success',
                  message: '操作成功!'
                })
              } else {
                this.active = 0
              }
            })
            
          }
        } else {
          return
        }
      })
      
    },
    // local
    getDataLocal(){
      this.basicFrom = JSON.parse(localStorage.getItem('basicFrom')) === null ? {
          username: '',
          gender: '',
          phone: '',
          idnum: '',
          city: null,
          cityword: '',
          birthday: '',
          homeaddress: '',
          nowaddress: '',
          maritalstatus: '',
        } : JSON.parse(localStorage.getItem('basicFrom'))
    },
    // test 
    patchCascader() {
      if (!/iPad|iPhone|iPod/.test(navigator.userAgent)) return;
      
      this.$nextTick(() => {
        const menus = document.querySelectorAll('.el-cascader-menu');
        menus.forEach(menu => {
          menu.querySelectorAll('.el-cascader-node').forEach(node => {
            node.style.cursor = 'pointer';
            node.addEventListener('touchend', (e) => {
              e.preventDefault();
              node.click();
            }, { passive: false });
          });
        });
      });
    }
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {

  },
  watch: {
  },
  //生命周期 - 挂载完成（可以访问DOM元素）// 在 mounted 钩子中修复
  mounted() {
    this.getDataLocal()
    this.patchCascader()
    if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
      const fixClick = (el) => {
        const dropdown = el.querySelector('.el-select-dropdown')
        if (dropdown) {
          dropdown.addEventListener('touchend', (e) => {
            e.preventDefault()
            e.target.click()
          })
        }
      }
      
      this.$nextTick(() => {
        // document.querySelectorAll('.el-select, .el-cascader').forEach(fixClick)
        document.querySelectorAll('.el-select').forEach(fixClick)
      })
    }

  },
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style lang='scss' scoped>
  //@import url(); 引入公共css类
.outsideBox {
  width: 100%;
  min-height: 100vh;
  background: #eeecec;
  .innerMessage {
    width: 96%;
    margin: 0 auto;
    .topBoxSteps {
      width: 96%;
      padding: 10px 2%;
    }
    .basicUser {
      width: 100%;
      height: auto;
    }
    .detailMsg {
      width: 98%;
      padding: 0 1% 60px 1%;
      .workMsg {
        margin: 15px 0;
        background: #bfbfbf;
        width: 100%;
        text-align: center;
        height: 30px;
        line-height: 30px;
        color: #fff;
      }
    }
    .lastPage {
      width: 98%;
      padding: 0 1% 60px 1%;
      .okBox {
        width: 100px;
        height: 100px;
        margin: 20px auto;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .okMsg {
        width: 100%;
        text-align: center;
        height: auto;
        word-wrap: break-word;
      }
    }
    .bottomBtn {
      width: 96%;
      height: 50px;
      line-height: 50px;
      text-align: center;
      background: #fff;
      position: fixed;
      bottom: 10px;
    }
    .lastBtn {
      display: none;
    }
  }
}

.el-collapse-item__header {
  padding: 0 10px;
}

.el-scrollbar {
    .el-scrollbar__bar {
        opacity: 1 !important;
    }
}
.el-scrollbar {
  > .el-scrollbar__bar {
    opacity: 1;
  }
} 
</style>
